from aiogram_dialog import Dialog

from poker_bot.tg_bot.dialogs.extras import copy_start_data_to_ctx
from poker_bot.tg_bot.dialogs.getters.accounts import unconfirmed_accounts_getter
from poker_bot.tg_bot.dialogs.reusable_windows import get_list_window
from poker_bot.tg_bot.states import AccountsForConfirmationSG

from .handlers import select_account

accounts_for_confirmation_dialog = Dialog(
    get_list_window(
        "unconfirmed-accounts-msg",
        "№{item.id} {item.account_id} {item.created_at}",
        "unconfirmed_accounts",
        AccountsForConfirmationSG.accounts_list,
        unconfirmed_accounts_getter,
        handler=select_account,
    ),
    on_start=copy_start_data_to_ctx,
)
